package com.quanyue.haircut.order.controller;

import com.quanyue.auto.util.ServiceResult;
import com.quanyue.haircut.order.dto.CommissionResult;
import com.quanyue.haircut.order.service.OrderCountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "技师提成统计")
@RestController
@RequestMapping("/api")
public class OrderCountController {
    @Autowired
    private OrderCountService orderCountService;

    @ApiModelProperty(value = "根据技师ID查询提成")
    @GetMapping(value = "/commission", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ServiceResult <CommissionResult> createOrder(@RequestParam Integer technicianId) {
        return ServiceResult.success(orderCountService.findCommission(technicianId));
    }

}
